﻿
@{
    ViewBag.Title = "UpgradeWorkingTime";
    Layout = "~/Views/Shared/_Index.cshtml";
}
<script>
    $(function () {
        gridList();
    });

    function gridList() {
        var $gridList = $("#HisgridList");
        $gridList.newtouchLocalDataGrid({
            //url: "/PatientManage/HospiterRes/GetGridJson",
            shrinkToFit: true,
            unwritten: false,
            height: $(window).height() - 185,
            datatype: "local",
            colModel: [
                { label: "主键", name: "id", hidden: true, key: true },
                { label: '工号', name: 'id', width: 50, align: 'left' },
                { label: '科室', name: 'ks', width: 100, align: 'left' },
                { label: '治疗师姓名', name: 'zlsxm', width: 80, align: 'left' },
                { label: '实际时长(分)', name: 'sjsc', width: 80, align: 'left' },
                { label: '调整时长(分)', name: 'sc', width: 50, align: 'left', editable: true },
                { label: '调整理由', name: 'note', align: 'left', editable: true },
            ],
            afterInsertRow: function (rowid) {
                //var ids = $gridList.jqGrid('getDataIDs');
                //for (var i = 0; i < ids.length; i++) {
                $gridList.jqGrid('editRow', rowid, true, null, function (result) {
                    //return false;   //验证输入内容是否合法，取消保存返回false    //无效 等等修复
                    //});
                });

            },
            pager: "#gridPager",
            sortname: 'desc',
            rowNum: '10',
            viewrecords: true
        });

        var mydata = [
               { id: "3214", zlsxm: "李慧Coco", sc: "240", note: "123", ks: "内一科", sjsc: "240" },
               { id: "6574", zlsxm: "扬子Eric", sc: "1000", note: "123", ks: "内二科", sjsc: "1000" },
               { id: "9812", zlsxm: "蒋朝凤Joanna", sc: "360", note: "123", ks: "内一科", sjsc: "360" },
        ];
        for (var i = 0; i <= mydata.length; i++) {
            $gridList.jqGrid('addRowData', i + 1, mydata[i]);
        }
        $gridList.closest(".ui-jqgrid-bdiv").css({ 'overflow-x': 'hidden' });
    }
</script>
<form id="form1">
    <div class="panel panel-default" style="margin-top:5px;">
        <div class="panel-heading">
            查询条件
        </div>
        <div style="padding: 2px;padding-right:20px;">
            <table class="form" style="width:70%">
                <tr>
                    <th class="formTitle">日期：</th>
                    <td class="formValue">
                        <input id="Kssj" type="text" class="form-control input-wdatepicker" value="@DateTime.Now.ToString("yyyy-MM-dd")" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" />
                    </td>
                    <th class="formTitle">科室：</th>
                    <td class="formValue">
                        <select id="Cl" class="form-control">
                            <option value="PT">内一科</option>
                            <option value="OT">内二科</option>
                        </select>
                    </td>
                    <th class="formTitle">治疗师：</th>
                    <td class="formValue">
                        <input id="txtSRM" type="text" class="form-control" placeholder="拼音 工号 名称" />
                    </td>
                    <td class="formValue">
                        <input type="button" id="btn_search" class="btn btn-primary" style="width:50px; margin-left:40px;" value="查询" />
                    </td>
                </tr>
            </table>
        </div>
    </div>
    <div class="gridPanel">
        <table id="HisgridList"></table>
        <div id="gridPager" rel="form1"></div>
    </div>
</form>
